package com.zhuiyun.project.cyclingapplet.controller;


import com.alibaba.fastjson2.JSONObject;
import com.zhuiyun.project.cyclingapplet.entity.ActivityPath;
import com.zhuiyun.project.cyclingapplet.service.IActivityPathService;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Ssb
 * @since 2024-07-22
 */
@RestController
@RequestMapping("/cyclingapplet/activityPath")
public class ActivityPathController {
    @Autowired
    IActivityPathService iactivityPathService;

    @RequestMapping("/selectActivityPath")
    public Map<String, Object> selectActivityPath(@RequestBody String jsonStr){
        JSONObject jsonObj = JSONObject.parseObject(jsonStr);
        int pathId = jsonObj.getInteger("pathId");
        ActivityPath select = iactivityPathService.selectActivityPath(pathId);
        Map<String,Object> m = new HashMap<>();
        m.put("code", "3333");
        m.put("msg", "查询成功");
        m.put("data", select);
        return m;
    }

}
